//
//  LHTableViewCell.m
//  play
//
//  Created by zhouLiHuan on 2016/12/12.
//  Copyright © 2016年 zhouLiHuan. All rights reserved.
//

#import "LHTableViewCell.h"
#import "FamilyModel.h"

@interface LHTableViewCell ()

@property (nonatomic,strong)UIImageView *heardImgView;

@property (nonatomic,strong)UILabel *namelabel;

@property (nonatomic,strong)UILabel *telPhoneLabel;

@end

@implementation LHTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self creatCell];
    }
    
    return self;
}

- (void)creatCell{

    self.heardImgView = [[UIImageView alloc] initWithFrame:CGRectMake(kAllViewMargin, 10, 60, 60)];
    [self.heardImgView sd_setImageWithURL:nil placeholderImage:[UIImage imageNamed:@""] options:SDWebImageRetryFailed];
    [self.contentView addSubview:self.heardImgView];
    
    self.namelabel = [[UILabel alloc] initWithFrame:CGRectMake(self.heardImgView.right+10,32, 50, 16)];
    [self.contentView addSubview:self.namelabel];
    
    self.telPhoneLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.namelabel.right +10, self.namelabel.top,120, self.namelabel.height)];
    [self.contentView addSubview:self.telPhoneLabel];
    
}

- (void)setFamilModel:(FamilyModel *)familModel{

    _familModel = familModel;
    self.imageView.image = [UIImage imageNamed:_familModel.image];
    self.namelabel.text = _familModel.name;
    self.telPhoneLabel.text = familModel.telPhone;
    
}

@end
